home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: seebs@solutions.solon.com (Peter Seebach)
- Newsgroups: comp.lang.ada,comp.lang.c++,comp.lang.c,comp.lang.modula3,comp.lang.modula2,comp.lang.eiffel
- Subject: Re: Hungarian notation
- Date: 22 Jan 1996 22:15:36 -0600
- Organization: Usenet Fact Police (Undercover)
- Message-ID: <4e1nd8$hv0@solutions.solon.com>
- References: <30C40F77.53B5@swsbbs.com> <4d2ok0$69s@beach.and.nl> <4dtv3gINNo9u@keats.ugrad.cs.ubc.ca> <SPENCER.96Jan22113215@zorgon.ERA.COM>
- NNTP-Posting-Host: solutions.solon.com
-
- In article <SPENCER.96Jan22113215@zorgon.ERA.COM>,
- Spencer Allain <spencer@ERA.COM> wrote:
- >It is incorrect to say that a 'char' (of size 1 byte on many systems)
- >and an 'int' (of size 4 bytes on many systems) is structurally
- >equivalent, yet I must be able to compile this without errors:
- >(warnings are _not_ errors -- though I get none compiling this anyway)
-
- > char a;
- > int b;
-
- > int main()
- > {
- > b = -154267 ;
- > a = b ;
- > return 0 ;
- > }
-
- No warnings, perhaps, but undefined behavior unless CHAR_MIN is
- less than or equal to -154267.
-
- And yes, we know C intentionally gives up some type safety for being
- easy to compile.
-
- :)
-
- -s
- --
- Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
- C/Unix proto-wizard -- C/Unix questions? Send mail for help. No, really!
- Using trn? Weird new newsgroup problem? I know the fix! Email me!
- The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
-